<?php
defined('_JEXEC') or die('Restricted access');
global $mainframe;
$document =& JFactory::getDocument();

$document->addStyleSheet('components/com_wrecruit/css/other_employers.css');
$model = $this->getModel('wrecruit', 'WRecruitModel');
?>
<style type="text/css">
	
</style>
<script language="Javascript">
    
</script>

<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td valign="top" class="<?php echo $this->theme['title']; ?>"><?php echo $this->config['title']; ?>
		</td>
	</tr>
	<tr>
		<td height="25"></td>
	</tr>
	<tr>
		<td class="wrecruitmsg"><?php echo $this->config['offline_text']; ?>
		</td>
	</tr>
</table>
<?php }
else{
	if (isset($this->userrole->rolefor)){
		if ($this->userrole->rolefor == 1) // employer
		$allowed = true;
		else
		$allowed = false;
	}
	else { if ($this->config['visitorview_emp_conrolpanel'] == 1) $allowed = true; else $allowed = false; } // user not logined
	if ($allowed == true) {
		?>
<div class="box-list-job">
	<div class="job-seeker-panel">
	<?php include 'left_panel.php';?>
	</div>
	<div class="job-seeker-right">
		<div class="head-title">
			<h2>CV Review</h2>
		</div>
	<?php foreach ($this->cvdetails as $item) {?>
		<div id="box-head">
			<div style="float:right;margin:10px;">
				<img alt="photo" src="components/com_wrecruit/images/candidate_pic.png" /><br/><br/>
				<a href="#">Add to your candidate list</a><br/>
				<a href="#">download full CV in PDF</a>
			</div>
			<p>
				<span class="title">CV title:</span>
				<span class="description"><?php echo $item->application_title;?></span>
			</p>
			<p>
				<span class="title">Name:</span>
				<span class="description"><?php echo $item->name;?></span>
			</p>
			<p>
				<span class="title">Sex:</span>
				<span class="description"><?php echo $item->gender_id;?></span>
			</p>
			<p>
				<span class="title">Date of birth:</span>
				<span class="description"><?php echo $item->date_of_birth;?></span>
			</p>
			<p>
				<span class="title">Highest education:</span>
				<span class="description"><?php echo $item->education;?></span>
			</p>
			<p>
				<span class="title">Career domain:</span>
				<span class="description"><?php echo $item->cat_title;?></span>
			</p>
			<p>
				<span class="title">Expected salary:</span>
				<span class="description"><?php echo $item->rangestart.'-'.$item->rangeend;?></span>
			</p>
			<p>
				<span class="title">Last updated:</span>
				<span class="description"><?php echo $item->date_modified;?></span>
			</p>
			<p>
				<span class="title">Past experience:</span>
				<span class="description"></span>
			</p>
		</div>
		<div class="box-review">
			<h3>Contact info</h3>
			<p>
				<span class="title">Email:</span>
				<span class="description"><?php echo $item->email;?></span>
			</p>
			<p>
				<span class="title">Tel:</span>
				<span class="description"><?php echo $item->phone;?></span>
			</p>
			<p>
				<span class="title">Address:</span>
				<span class="description"><?php echo $item->address;?></span>
			</p>
		</div>
		<div class="box-review">
			<h3>Career objective</h3>
			<p><?php echo $item->career_objective;?></p>
		</div>
		<div class="box-review">
			<h3>Professional experiences</h3>
			<div class="box-experience-review">
				<h4><?php echo $item->employer3_position;?></h4>
				<p>
					<span><strong><?php echo $item->employer3;?></strong></span><br/>
					<?php echo $item->employer3_address;?>
				</p>
				<h4><?php echo $item->employer2_position;?></h4>
				<p>
					<span><strong><?php echo $item->employer2;?></strong></span><br/>
					<?php echo $item->employer2_address;?>
				</p>
				<h4><?php echo $item->employer1_position;?></h4>
				<p>
					<span><strong><?php echo $item->employer1;?></strong></span><br/>
					<?php echo $item->employer1_address;?>
				</p>
			</div>
		</div>
		<div class="box-review">
			<h3>Education/training</h3>
			<div class="box-edu-review">
				<h4><?php echo $item->institute3;?></h4>
				<p>
					<span><?php echo $item->institute3_certificate_name;?></span><br/>
					<?php echo $item->institute3_level;?>|<?php echo $item->institute3_cert_year;?>|
					<?php echo $item->institute3_study_area;?>|<?php echo $item->institute3_country;?>
				</p>
				<h4><?php echo $item->institute2;?></h4>
				<p>
					<span><?php echo $item->institute2_certificate_name;?></span><br/>
					<?php echo $item->institute2_level;?>|<?php echo $item->institute2_cert_year;?>|
					<?php echo $item->institute2_study_area;?>|<?php echo $item->institute2_country;?>
				</p>
				<h4><?php echo $item->institute1;?></h4>
				<p>
					<span><?php echo $item->institute1_certificate_name;?></span><br/>
					<?php echo $item->institute1_level;?>|<?php echo $item->institute1_cert_year;?>|
					<?php echo $item->institute1_study_area;?>|<?php echo $item->institute1_country;?>
				</p>
			</div>
		</div>
		<div class="box-review">
			<h3>Skills</h3>
			<?php 
				if($item->skill!=null){
					$skill = explode(',',$item->skill);
					foreach ($skill as $val) {
						echo '<span class="skill">'.$val.'</span>';
					}
					
				}
			?>
		</div>
		
		<div class="box-review">
			<h3>References</h3>
			<div class="box-reference-review">
				<h4><?php echo $item->reference3;?></h4>
				<p>
					<?php echo $item->reference3_relation;?>|<?php echo $item->reference3_years;?>|
					<?php echo $item->reference3_phone;?>|<?php echo $item->reference3_address;?>
				</p>
				<h4><?php echo $item->reference2;?></h4>
				<p>
					<?php echo $item->reference2_relation;?>|<?php echo $item->reference2_years;?>|
					<?php echo $item->reference2_phone;?>|<?php echo $item->reference2_address;?>
				</p>
				<h4><?php echo $item->reference1;?></h4>
				<p>
					<?php echo $item->reference1_relation;?>|<?php echo $item->reference1_years;?>|
					<?php echo $item->reference1_phone;?>|<?php echo $item->reference1_address;?>
				</p>
			</div>
		</div>
	<?php }?>	
	</div>	
</div>
<?php } else{ // not allowed job posting
		//Update by Vireak on 28/06/2012
		//Add frame to this warning and some styling
		//---------------------
		echo '<div class="box-list"><div class="head-title"><h2>Oop!</h2></div>';
		echo '<span class="wr_info"><p>'.JText::_('JS_YOU_ARE_NOT_ALLOWED_TO_VIEW').'</p>';
		echo '<p>This page is reserved for the authorized candidates only. </p></span>';
		echo '</div>';
		//---------------------
	}
}//ol
?>
<div width="100%">
<?php
if($this->config['fr_cr_txsh']) {
	echo
	'<table width="100%" style="table-layout:fixed;">
		<tr><td height="15"></td></tr>
		<tr><td style="vertical-align:top;" align="center">'.$this->config['fr_cr_txa'].$this->config['fr_cr_txb'].'</td></tr>
	</table>';
}
?>
</div>
